package com.nercel.dsj.gksales.service.impl;

import com.nercel.dsj.gksales.service.UrlService;
import com.nercel.dsj.gksales.util.SafeBase64;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @author sunlin
 * @date 2019-4-16
 */
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UrlServiceImpl implements UrlService {

	@Value("${app.host}")
	private String APP_HOST;

	@Override
	public String generateUrl(String url) {
		return APP_HOST + "api/v1/url/" + SafeBase64.safeUrlBase64Encode(url);
	}

}
